<template>
  <div class="box">
    <h1>父组件</h1>
    <button @click="isShow = !isShow">切换组件</button>
    <v-child v-if="isShow"></v-child>
  </div>
</template>

<script>
import vChild from "./child.vue"
import {ref} from "vue"
export default {
    components:{
        vChild
    },
    setup(){
        let isShow = ref(false);
        return {
            isShow
        }
    }
}
</script>

<style>

</style>